package com.company.book_store.service;

import com.company.book_store.dao.Bookinfoddao;
import com.company.book_store.dao.Ibookinfodao;
import com.company.book_store.pojo.Bookinfo;

import java.util.List;

public class Bookinfoservice implements Ibookinfoservice{
    private Ibookinfodao ibookinfodao=new Bookinfoddao();
    @Override
    public List<Bookinfo> selectByusername(String username) {
        return ibookinfodao.selectByusername(username);
    }
    @Override
    public int deletebookinfo(int id,int book_id) {
        return ibookinfodao.deletebookinfo(id,book_id);
    }
    @Override
    public Bookinfo selectByusernameandid(int id, int book_id) {
        return ibookinfodao.selectByusernameandid(id,book_id);
    }

    public static void main(String[] args) {
        Ibookinfoservice ibookinfoservice=new Bookinfoservice();
//        List<Bookinfo>list=ibookinfoservice.selectByusername("201809601121");
//        for(Bookinfo bookinfo:list)
//        {
//            System.out.println(bookinfo);
//        }
        System.out.println(ibookinfoservice.selectByusername("admin"));
    }
}
